Skip to main content

Moment NFT Properties

Get properties for a NFT moment.

Parameters:

  • address: The Flow Address of the account whose moment data needs to be read
  • id: The id of the NFT moment

Returns [AnyStruct] - An array of nft properties.

import NonFungibleToken from 0xNONFUNGIBLETOKENADDRESS
import UFC_NFT from 0xUFCNFTADDRESS

pub fun main(address: Address, id: UInt64): [AnyStruct] {
let account = getAccount(address)

let collectionRef = account.getCapability(UFC_NFT.CollectionPublicPath)
.borrow<&{UFC_NFT.UFC_NFTCollectionPublic}>()
?? panic("Could not borrow capability from public collection")

let nft = collectionRef.borrowUFC_NFT(id: id) ?? panic("Couldn't borrow borrowUFC_NFT")

return [nft.id, nft.editionNum, nft.setId]
}